const app = getApp()
export default {
  props: {
    //类型  img 图片背景， swiper  轮播背景
    type: {
      type: String,
      default: 'img'
    },
    //头部背景
    headerBg: {
      type: String,
      default: 'http://ltcx-img.oss-cn-beijing.aliyuncs.com/miniprogram/seize_seat.png'
    },
    height: {
      type: String,
      default: this.type == 'img' ? '550rpx' : '448rpx'
    }
  },
  data() {
    return {
    }
  },
  watch: {
  },
  computed: {
    //状态栏高度
    statusBarHeight() {
      let { statusBarHeight } = app.globalData.systemInfo;
      return statusBarHeight;
    },
    headerStyle() {
      switch (this.type) {
        case 'img':
          return { height: this.height, 'background-image': `url(${this.headerBg})`, 'background-size': `100% ${this.height}`}
      }
    }
  },
  mounted() {
  },
  methods: {
    //返回到上一页
    handleBack() {
      uni.navigateBack()
    },
  }
}